/*
 clear .css file by nodejs 
*/import React, { Component,  } from 'react'
import PropTypes from 'prop-types'
/*
* 左侧label标签 参考个人资料 
* label: string 标题
* type : string 类型，
* text : string type=='text'时 text为文本，type=='image'时text为url
* arrow : bool 是否显示箭头
* ouTouch : function 点击的回调
*/
export default class LabelTextItems extends Component{
  render(){
    let {label, text, type, arrow, ouTouch ,isfile } = this.props
    return (
      isfile?(
         <div  className="lwui_cell">
          <input  type="file" className="inputfile" accept="image/jpg,image/jpeg,image/png,image/gif"  onChange={ouTouch.bind(this)}/>
          <div className="lwui_cell_hd">
            <label className="lwui_label">{label}</label>
          </div>
          <div className="lwui_cell_primary lwui_from_right">
            {
              type === 'text'?(<span className="lwui_text">{text}</span>):
              (type === 'image'?(<img className="account-profile-avatar" src={text} alt=""/>):null)
            }
          </div>
          { arrow ? (<img className="nav-right" src="assets/images/icons/ic_list_arrow@2x.png" />):null}
        </div>
        ):(
        <div className="lwui_cell"  onClick={ouTouch}>
          <div className="lwui_cell_hd">
            <label className="lwui_label">{label}</label>
          </div>
          <div className="lwui_cell_primary lwui_from_right">
            {
              type === 'text'?(<span className="lwui_text">{text}</span>):
              (type === 'image'?(<img className="account-profile-avatar" src={text} alt=""/>):null)
            }
          </div>
          { arrow ? (<img className="nav-right" src="assets/images/icons/ic_list_arrow@2x.png" />):null}
        </div>
      )
    )
  }
}
